import Mock from 'mockjs'

export const loginMock = (req) => {
    const { username, password } = JSON.parse(req.body)
    if (username === 'admin' && password === '123456') {
        return {
            code: 200,
            msg: '登录成功',
            data: {
                token: Mock.Random.string('upper', 32),
            },
        }
    }
    return {
        code: 400,
        msg: '登录失败',
    }
}